<?php
	header('content-type:text/html;charset="utf-8"');
	header('Access-Control-Allow-Origin:*');
	header('Access-Control-Allow-Methods:POST');
	header('Access-Control-Allow-Headers:x-requested-with,content-type');
	// 连接数据库
	$db = mysql_connect("bdm291307286.my3w.com", "bdm291307286", "zn15890989005");
	//这里的信息修改成你们自己的
	mysql_query("SET NAMES UTF8");
	// 设置编码
	//如果连接数据库成功
	mysql_select_db("bdm291307286_db"); 
	if($db){
		//选择数据库
		mysql_select_db("bdm291307286_db"); 
		if(isset($_POST['name'])){
			$username=$_POST['name'];
			$password=md5($_POST['pass']);
		}else{
			exit('非法操作');
		}
			$query = "select * from logininfo where loginName='$username' and password='$password'";
			$result = mysql_query($query);
			//echo json_encode($result);
			if (mysql_fetch_array($result)) {
				echo 'true';
			} else {
				echo '';
			}
	}else{
		echo "error";
	}
//	if(isset($_POST['name'])){//前端ajax传输过来的额
//		$username=$_POST['name'];
//		$password=md5($_POST['pass']);
//	}else{
//			exit('非法操作');
//	}
//	
//	$query = "select * from logininfo where loginName='$username' and password='$password'";
//	$result = mysql_query($query);
//	//echo json_encode($result);
//	if (mysql_fetch_array($result)) {
//		echo 'true';
//	} else {
//		echo '';
//	}
?>